

exports.errorHandler = ((err, req, res, next) => {
    // 身份认证失败错误
    console.log(req.originalUrl,'originalUrl');
    if (req.originalUrl == "/check/barCodeMsg") {
      next()
      return
    }
      
    if (err.name === "UnauthorziedError")
      return res.send({ status: 401, message: "无效的token！" });
    // 其它错误
    res.send({
      status: 500,
      message: err.message,
    });
})
  